/**
 * 地图相关配置
 */
let prot = 'http:'
if (window && window.location && window.location.protocol === 'https:') {
  prot = 'https:'
}
export default {
  tiandituMapUrl: {
    vecLayerUrl: `${prot}//{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=f05b78140e12c03d46f442c71cb77550`, // 天地图街道切片图层url
    vecCvaLayerUrl: `${prot}//{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=f05b78140e12c03d46f442c71cb77550`, // 天地图注记切片图层url
    imgLayerUrl: `${prot}//{s}.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=f05b78140e12c03d46f442c71cb77550`, // 天地图影像切片图层
    imgLayerParams: {
      subdomains: ['t0', 't1', 't2', 't3', 't4', 't5', 't6', 't7'],
      detectRetina: false
    },
    imgCvaLayerUrl: `${prot}//{s}.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=f05b78140e12c03d46f442c71cb77550`, // 天地图影像注记切片图层
    imgCvaLayerParams: {
      subdomains: ['t0', 't1', 't2', 't3', 't4', 't5', 't6', 't7'],
      detectRetina: false
    }
  }
}
export function setTiandituMap(MainMap) {
  if (MainMap) {
    MainMap.setMapConfig({
      tianditu: {
        vecLayerUrl: `${prot}//{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=f05b78140e12c03d46f442c71cb77550`, // 天地图街道切片图层url
        cvaLayerUrl: `${prot}//{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=f05b78140e12c03d46f442c71cb77550` // 天地图注记切片图层url
      }
    })
  }
}
